//
//  ViewController.swift
//  PopView
//
//  Created by chengfeiheng on 16/3/24.
//  Copyright © 2016年 chengfeisoft. All rights reserved.
//

import UIKit

class ViewController: UIViewController,PopBottomViewDataSource,PopBottomViewDelegate {
    
    override func viewDidLoad() {
        super.viewDidLoad()
    }
    
    @IBAction func didClickShare(){
        let v = PopBottomView(frame: self.view.bounds)
        v.dataSource = self
        v.delegate = self
        v.showInView(self.view)
    }
    
    func hide(){
        for v in self.view.subviews {
            if let vv = v as? PopBottomView{
                vv.hide()
            }
        }
    }
    
    //MARK : - PopBottomViewDataSource
    func viewPop() -> UIView {
        let v = UIView.loadFromNibNamed("BottomView") as! BottomView
        v.cancelButton.addTarget(self, action: "hide", forControlEvents: .TouchUpInside)
        
        return v
    }
    
    func viewHeight() -> CGFloat {
        return 200.0
    }
    
    func isEffectView() -> Bool {
        return true
    }
    
    
    //MARK: - PopBottomViewDataDelegate
    
}

